<template>
    <div>
        <el-descriptions class="margin-top" title="订单信息表" :column="4"  style="margin-top: 20px">
            <el-descriptions-item label="订单编号">{{order.orderno}}</el-descriptions-item>
            <el-descriptions-item label="下单用户">{{order.username}}</el-descriptions-item>
            <el-descriptions-item label="订单状态">
                <span v-if="order.status==1"><el-tag>待接单</el-tag></span>
                <span v-if="order.status==2"><el-tag type="info">待完成</el-tag></span>
                <span v-if="order.status==3 || scope.row.status==4"><el-tag type="success">已完成</el-tag></span>
                <span v-if="order.status==4"><el-tag type="warning">待评价</el-tag></span>
                <span v-if="order.status==5"><el-tag type="danger">已失效</el-tag></span>
            </el-descriptions-item>
            <el-descriptions-item label="实际支付">
                <div style="font-size: large;color: red;font-weight: bold">{{order.orderPrice}}</div>
            </el-descriptions-item>
            <el-descriptions-item label="接单员工">{{order.emp}}</el-descriptions-item>
            <el-descriptions-item label="员工电话">{{order.empTel}}</el-descriptions-item>
            <el-descriptions-item label="订单联系人">{{order.contactPerson}}</el-descriptions-item>
            <el-descriptions-item label="联系人电话">{{order.userTel}}</el-descriptions-item>
            <el-descriptions-item label="支付时间">{{order.payTime}}</el-descriptions-item>
            <el-descriptions-item label="完成时间">{{order.finishTime}}</el-descriptions-item>
            <el-descriptions-item label="期望上门时间">{{order.expectTime}}</el-descriptions-item>
            <el-descriptions-item label="产品原价">{{order.productPrice}}</el-descriptions-item>
            <el-descriptions-item label="订单折扣">
                <div v-if="order.coupon!=0" style="font-size: large;color: red;font-weight: bold">-{{order.coupon}}</div>
                <div v-else>0</div>
            </el-descriptions-item>
            <el-descriptions-item label="订单地址" >{{order.address}}</el-descriptions-item>
            <el-descriptions-item v-if="order.ps!=''" label="订单备注" >{{order.ps}}</el-descriptions-item>
            <el-descriptions-item v-else label="订单备注" :span="2">无</el-descriptions-item>
        </el-descriptions>
    </div>
</template>

<script>
    export default {
        name: "orderDetail",
        data() {
            return {
                order:null
            };
        },
        created() {
            var oid=this.$route.query.oid
            var that=this;
            this.$ajax.post('/jz/order/getOrderInfo?id='+oid).then(function (resp) {
                console.log(resp.data);
                if(resp.data.status==200){
                    that.order=resp.data.orderInfo;
                }

            })
        }
    }
</script>

<style scoped>

</style>
